<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
   <p> 1.计算圆的周长和面积</p>
    请输入圆的半径：<input type="text" id="a1"><button onclick="jisuan()">计算</button><br>
    圆的周长：<input type="text" id="a2"><br>
    圆的面积：<input type="text" id="a3"><br>
    <p>2.四则运算</p>
<p>请输入第一个数：<input type="text" id="num1" value="" ></p>
<p>请输入第二个数：<input type="text" id="num2" value=""></p>
<p>答案：<input type="text" id="num3" value=""></p>
<p><input type="button" value="加" id="jia" onclick="jiafa()" >
    <input type="button" value="减" id="jian" onclick="jianfa()" >
    <input type="button" value="乘" id="cheng" onclick="chengfa()">
    <input type="button" value="除" id="chu" onclick="chufa()"></p>
    <p>3.流程控制-选择</p>
    <p>请输入你的成绩：<input type="text" id="chengji" value=""></p>
    <input type="button" value="查询" id="chaxun" onclick="chaxun()"></p>
    <p>你的成绩等级是：<input type="text" id="dengji"></p>
    <p>4.流程控制-循环 1）求100以内偶数的和 2）打印金字塔</p>
    <p>100以内偶数和为：<input type="text" id="sum" value=""></p>
    <p>2）打印金字塔</p>
    <p></p>请输入打印行：<input type="text" id="jzt" value=""><input type="button" value="打印" id="dayin" onclick="dayin()"></p>
    <span id="jzttx"></span>
    <p>3）打印九九乘法表</p>
</body>
<script>
function jisuan(){

    var r=document.getElementById('a1').value;
    var c=2*Math.PI.toFixed(2)*r;
    var a=r*Math.PI.toFixed(2)*r;

    document.getElementById('a2').value=c.toFixed(2);
    document.getElementById('a3').value=a.toFixed(2);

}
var x =document.getElementById("num1");
    var y =document.getElementById("num2");
    jiafa=function() {
        document.getElementById("num3").value = parseFloat(x.value)+ parseFloat(y.value);
    }
    jianfa=function() {
        document.getElementById("num3").value = parseFloat(x.value)-parseFloat(y.value);
    }
    chengfa=function() {
        document.getElementById("num3").value = parseFloat(x.value)*parseFloat(y.value);
    }
    chufa=function() {
        document.getElementById("num3").value = parseFloat(x.value)/ parseFloat(y.value);
    }
    var score= document.getElementById("chengji");
    chaxun=function(){
             var aa= score.value;
            
            switch(parseInt(aa/10)){
            case 10:
            case 9:document.getElementById("dengji").value="优";break;
            case 8:document.getElementById("dengji").value="良";break;
            default:document.getElementById("dengji").value="差";break;}}
            var sum=0; i=1 ;
    for( i=1;i<=100;i++){
        if(i%2==0){
            sum=sum+i;
        }
    }
    document.getElementById("sum").value=sum;
    dayin=function(){
        var n =jzt.value ;
       
        for(var i=1;i<=n;i++){
            for(var j=i-1;j<n;j++){
                
                document.write("&nbsp;")
            }
            for(var k = 1; k <= i; k++){
                document.write("6")
            }
            document.write("<br>")
        }
    }
    for (var n=1;n<=9;n++) {

for (var m=1;m<n+1;m++) {

var b=m*n;

document.write(m+"×"+n+"="+b+" "+" ");

    }

    document.write("<br/>");

    document.write("<br/>");

}


</script>
</html>